package com.zmx.patientend;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.patientend.adapter.IntelligentTitleAdapter;
import com.zmx.patientend.view.activity.PatientsLocation;
import com.zmx.patientend.view.util.MySharedPreferences;

import butterknife.BindView;
import butterknife.ButterKnife;
import de.hdodenhof.circleimageview.CircleImageView;

/**
 * 程序猿：胖胖祥
 * 时 间：2020/11/13  13:15
 * 功 能：
 */
public class PatientsLocationAdapter extends BaseAdapterRvList<PatientsLocationAdapter.ViewHolder, PatientsLocation> {

    public PatientsLocationAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, PatientsLocation patientsLocation) {

        holder.name.setText(patientsLocation.getName());
        Glide.with(mActivity).load(patientsLocation.getAvatar()).into(holder.head);


    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {
        PatientsLocationAdapter.ViewHolder holder = new PatientsLocationAdapter.ViewHolder(inflater.inflate(R.layout.adapter_patients_location, parent, false));
        return holder;
    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.name)
        TextView name;
        @BindView(R.id.tou)
        CircleImageView head;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

    }


}
